/*
package com.atguigu.day09.work;

import java.util.Objects;

public class Triangle {
    private double a;
    private double b;
    private double c;

    public Triangle(double a, double b, double c) {
        if (a + b > c && a + c > b && b + c > a && a > 0 & b > 0 && c > 0) {
            this.a = a;
            this.b = b;
            this.c = c;
        } else {
            System.out.println("三条边无法构成三角形");
        }
    }

    public double getA() {
        return a;
    }

    public double getB() {
        return b;
    }

    public double getC() {
        return c;
    }


    @Override
    public int hashCode() {
        return super.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if(this==obj)
            return true;
        if(obj==null||getClass()!=obj.getClass())
            return false;
        Triangle triangle=(Triangle) obj;
        return getArea()==Triangle.getArea()&&Objects.equals(getArea(),getPiremeter());
    }

    public double getArea() {
        double p = (a + b + c) / 2;
        return Math.sqrt(p * (p - a) * (p - b) * (p - c));
    }
    public double getPiremeter(){
        return a+b+c;
    }

    @Override
    public String toString() {
        return "Triangle{" +
                "a=" + a +
                ", b=" + b +
                ", c=" + c +
                '}'+"面积是:"+getArea()+"周长是:"+getPiremeter();
    }
}*/
